﻿package bdz.extensions.b2d
{
	import flash.display.MovieClip;
	import flash.events.Event;
	
	import Box2D.Dynamics.*;
	import Box2D.Collision.*;
	import Box2D.Collision.Shapes.*;
	import Box2D.Common.Math.*;
	/**
	 * ...
	 * @author ...
	 */
	public class PhysicsEnvironment extends MovieClip
	{
		public static const POLYGON:String = b2PolygonDef;
		public static const CIRCLE:String = b2CircleDef;
		
		private var timestep:Number = 1 / 3;
		private var iterations:int = 10;
		
		private var world:b2World;
		private var wAABB:b2AABB;
		
		private var body:b2Body;
		
		private var autoRender:Boolean = true;
		private var bounds:Number = 100;
		private var gx:Number = 0;
		private var gy:Number = 10;
		
		function PhysicsEnvironment() {
			
			
		}
		private function createFloor():void {
			
		}
		private function createLeftWall():void {
			
		}
		public function render(evt:*= null):void {
			
		}
		public function initialize():void {
			wAABB = new b2AABB();
			wAABB.lowerBound.Set( -bounds, -bounds);
			wAABB.upperBound.Set(bounds, bounds);
			world = new b2World(wAABB, new b2Vec2(gx, gy), true);
			
		}
		public function addFloor(sprite:Object):void {
			
		}
		public function addLeftWall(sprite:Object):void {
			
		}
		public function addRightWall(sprite:Object):void {
			
		}
		public function addBody(sprite:Object, body:b2ShapeDef, props:Object) {
			
		}
		
		
	}
	
}